# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : baidu_hot.py
# @Author: dongguangwen
# @Date  : 2024-06-29 15:55
import requests
from lxml import etree


url = 'https://www.baidu.com/'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
}
resp = requests.get(url=url, headers=headers)
# print(resp.text)
html = etree.HTML(resp.text)
contents = html.xpath('//*[@class="title-content-title"]/text()')
for content in contents:
    print(content)

"""
习近平签署第二十五号主席令
“流动的中国”涌动蓬勃活力
乌苏里江上游发生实测以来最大洪水
网红面筋哥肝癌晚期进ICU
特朗普：首场辩论我大获全胜
芯片大牛股退市 曾号称对标英伟达
"""
